home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / defaultAreaLight.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  2.3 KB  |  78 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Procedure Name:
  19. //      defaultAreaLight
  20. //
  21. //  Description:
  22. //        create a default area light
  23. //
  24. //  Input Arguments:
  25. //      None.
  26. //
  27. //  Return Value:
  28. //      None.
  29. //
  30. global proc defaultAreaLight(
  31.     float $intensity,
  32.     float $colourR,
  33.     float $colourG,
  34.     float $colourB,
  35.     int   $decay,
  36.     int   $shadows,
  37.     float $shadowColourR,
  38.     float $shadowColourG,
  39.     float $shadowColourB,
  40.     int   $shadowSamples
  41. )
  42. {
  43.     string $lightName = `shadingNode -asLight areaLight`;
  44.     
  45.     // setOptionVars(false);
  46.  
  47.     string $cmd = ("setAttr " + $lightName + ".intensity " + `optionVar -query areaLightIntensity`);
  48.     eval $cmd;
  49.     
  50.     float $rgb[3] = `optionVar -query areaLightColor`;
  51.     $cmd = ("setAttr " + $lightName + ".colorR " + $rgb[0]);
  52.     eval $cmd;
  53.     $cmd = ("setAttr " + $lightName + ".colorG " + $rgb[1]);
  54.     eval $cmd;
  55.     $cmd = ("setAttr " + $lightName + ".colorB " + $rgb[2]);
  56.     eval $cmd;
  57.  
  58.     // cant do exclusive, not in areaLight command!!!!!
  59.  
  60.     $cmd = ("setAttr " + $lightName + ".decayRate " + `optionVar -query areaLightDecay`);
  61.     eval $cmd;
  62.  
  63.     $cmd = ("setAttr " + $lightName + ".useDepthMapShadows " + `optionVar -query areaLightShadows`);
  64.     eval $cmd;
  65.  
  66.     $rgb = `optionVar -query areaLightShadowColor`;
  67.     $cmd = ("setAttr " + $lightName + ".shadColorR " + $rgb[0]);
  68.     eval $cmd;
  69.     $cmd = ("setAttr " + $lightName + ".shadColorG " + $rgb[1]);
  70.     eval $cmd;
  71.     $cmd = ("setAttr " + $lightName + ".shadColorB " + $rgb[2]);
  72.     eval $cmd;
  73.  
  74.     select -r $lightName;
  75.  
  76.     objectMoveCommand;
  77. }
  78.